.class public Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;
.super Landroid/widget/ScrollView;


# instance fields
.field private a:Landroid/view/View;

.field private b:F

.field private c:Landroid/graphics/Rect;

.field private d:Z

.field private e:Z

.field private f:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0, p1}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;)V

    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->f:Z

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0, p1, p2}, Landroid/widget/ScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->f:Z

    return-void
.end method

.method private a()Z
    .locals 3

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getScrollY()I

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getHeight()I

    move-result v0

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getHeight()I

    move-result v1

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getScrollY()I

    move-result v2

    add-int/2addr v1, v2

    if-ge v0, v1, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private b()Z
    .locals 3

    iget-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getHeight()I

    move-result v0

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getHeight()I

    move-result v1

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getScrollY()I

    move-result v2

    add-int/2addr v1, v2

    if-gt v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public dispatchTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 7

    const/4 v1, 0x1

    const/4 v4, 0x0

    const/4 v0, 0x0

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    if-nez v2, :cond_0

    invoke-super {p0, p1}, Landroid/widget/ScrollView;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    :goto_0
    return v0

    :cond_0
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v2

    packed-switch v2, :pswitch_data_0

    :cond_1
    :goto_1
    invoke-super {p0, p1}, Landroid/widget/ScrollView;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    goto :goto_0

    :pswitch_0
    invoke-direct {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a()Z

    move-result v0

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    invoke-direct {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->b()Z

    move-result v0

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v0

    iput v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->b:F

    goto :goto_1

    :pswitch_1
    iget-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->f:Z

    if-eqz v1, :cond_1

    new-instance v1, Landroid/view/animation/TranslateAnimation;

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getTop()I

    move-result v2

    int-to-float v2, v2

    iget-object v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v3, v3, Landroid/graphics/Rect;->top:I

    int-to-float v3, v3

    invoke-direct {v1, v4, v4, v2, v3}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V

    const-wide/16 v2, 0x12c

    invoke-virtual {v1, v2, v3}, Landroid/view/animation/TranslateAnimation;->setDuration(J)V

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v2, v1}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V

    iget-object v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v2, v2, Landroid/graphics/Rect;->left:I

    iget-object v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v3, v3, Landroid/graphics/Rect;->top:I

    iget-object v4, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v4, v4, Landroid/graphics/Rect;->right:I

    iget-object v5, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v5, v5, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {v1, v2, v3, v4, v5}, Landroid/view/View;->layout(IIII)V

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->f:Z

    goto :goto_1

    :pswitch_2
    iget-boolean v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    if-nez v2, :cond_2

    iget-boolean v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    if-nez v2, :cond_2

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v0

    iput v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->b:F

    invoke-direct {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a()Z

    move-result v0

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    invoke-direct {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->b()Z

    move-result v0

    iput-boolean v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    goto :goto_1

    :cond_2
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v2

    iget v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->b:F

    sub-float/2addr v2, v3

    float-to-int v2, v2

    iget-boolean v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    if-eqz v3, :cond_3

    if-gtz v2, :cond_5

    :cond_3
    iget-boolean v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    if-eqz v3, :cond_4

    if-ltz v2, :cond_5

    :cond_4
    iget-boolean v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->e:Z

    if-eqz v3, :cond_6

    iget-boolean v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->d:Z

    if-eqz v3, :cond_6

    :cond_5
    move v0, v1

    :cond_6
    if-eqz v0, :cond_1

    int-to-float v0, v2

    const/high16 v2, 0x3f000000    # 0.5f

    mul-float/2addr v0, v2

    float-to-int v0, v0

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    iget-object v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v3, v3, Landroid/graphics/Rect;->left:I

    iget-object v4, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v4, v4, Landroid/graphics/Rect;->top:I

    add-int/2addr v4, v0

    iget-object v5, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v5, v5, Landroid/graphics/Rect;->right:I

    iget-object v6, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget v6, v6, Landroid/graphics/Rect;->bottom:I

    add-int/2addr v0, v6

    invoke-virtual {v2, v3, v4, v5, v0}, Landroid/view/View;->layout(IIII)V

    iput-boolean v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->f:Z

    goto/16 :goto_1

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method protected onFinishInflate()V
    .locals 1

    invoke-super {p0}, Landroid/widget/ScrollView;->onFinishInflate()V

    invoke-virtual {p0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getChildCount()I

    move-result v0

    if-lez v0, :cond_0

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    :cond_0
    return-void
.end method

.method protected onLayout(ZIIII)V
    .locals 5

    invoke-super/range {p0 .. p5}, Landroid/widget/ScrollView;->onLayout(ZIIII)V

    iget-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->c:Landroid/graphics/Rect;

    iget-object v1, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v1}, Landroid/view/View;->getLeft()I

    move-result v1

    iget-object v2, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getTop()I

    move-result v2

    iget-object v3, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getRight()I

    move-result v3

    iget-object v4, p0, Lcom/waiqin365/base/login/mainview/CustomReboundScrollView;->a:Landroid/view/View;

    invoke-virtual {v4}, Landroid/view/View;->getBottom()I

    move-result v4

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;->set(IIII)V

    goto :goto_0
.end method
